<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<c:if test="${not empty errors}">
	<c:forEach items="${errors}" var="error">
		${error.category} - ${error.message}<br />
	</c:forEach>
</c:if>

<form action="${pageContext.request.contextPath}/alunosPosGraduacao" method="post">
  
	<c:if test="${not empty alunoPosGraduacao.id}">
		<input type="hidden" name="alunoPosGraduacao.id" value="${alunoPosGraduacao.id}"/>
		<input type="hidden" name="_method" value="put"/>
	</c:if>

	<div class="field">
		Nome:<br />
	
		<input type="text" name="alunoPosGraduacao.nome" value="${alunoPosGraduacao.nome}"/>
	</div>
	
	<div class="field">
		Email:<br />
	
		<input type="text" name="alunoPosGraduacao.email" value="${alunoPosGraduacao.email}"/>
	</div>
	
	<div class="field">
		Data ingresso:<br />
	
		<input type="text" name="alunoPosGraduacao.dataIngresso" value="${alunoPosGraduacao.dataIngressoStr}"/>
	</div>
	
	<c:set var="regimesCurso" value="<%=br.com.puc.models.enums.TipoRegimeCurso.values()%>"/>
	<div class="field">	
		Regime curso:<br />
		<select name="alunoPosGraduacao.regimeCurso">    
		  <c:forEach var="r" items="${regimesCurso}">
		    <option value="${r}" ${r == alunoPosGraduacao.regimeCurso ? 'selected' : ''}>${r}</option>    
		  </c:forEach>    
		</select>
	</div>
	
	<c:set var="tiposAluno" value="<%=br.com.puc.models.enums.TipoAlunoPos.values()%>"/>
	<div class="field">	
		Tipo aluno:<br />
		<select name="alunoPosGraduacao.tipoAluno">    
		  <c:forEach var="t" items="${tiposAluno}">
		    <option value="${t}" ${t == alunoPosGraduacao.tipoAluno ? 'selected' : ''}>${t}</option>    
		  </c:forEach>    
		</select>
	</div>
	
	<div class="field">
		Orientador:<br />
		<select name="alunoPosGraduacao.orientador.id">    
		  <c:forEach var="p" items="${professores}">    
		    <option value="${p.id}" ${p.id eq alunoPosGraduacao.orientador.id ? 'selected' : ''}>${p.nome}</option>    
		  </c:forEach>    
		</select>  
	</div>
	
  <div class="actions">
	  <button type="submit">enviar</button>
	</div>
</form>

<a href="${pageContext.request.contextPath}/alunosPosGraduacao">Voltar</a>
